<template>
	<view>
		<z-paging ref="paging" v-model="dataList" @query="queryList" safe-area-inset-bottom >
			<view class="content">
				<view class="item" v-for="(item,index) in  dataList" :key="index">
					<u--text :text="'收款金额：￥'+item.actual_payment" color="#000" size="15px" bold margin="0px 0px 10px 0px"></u--text>
					<u--text :text="'时间：'+timetrans(item.updatetime)" color="#000" size="15px" bold ></u--text>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	export default {
		data() {
			return {
				dataList: []
			};
		},
		computed: {
			...mapGetters(['merchant'])
		},
		methods: {
			queryList(pageNo, pageSize) {
				this.$http.post('wanlshop/shop/collectionDetails', {
					limit: pageSize,
					page: pageNo,
					shop_id: this.merchant.id
				}).then(res => {
					res.code == 1 ? this.$refs.paging.complete(res.data.data) : this.$refs.paging.complete(false)
				})
			},
			timetrans(date) {
				var date = new Date(date * 1000); //如果date为10位需要乘1000
				var Y = date.getFullYear() + '-';
				var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
				var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
				var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
				var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
				return Y + M + D + h + m + s;
			}
		}
	}
</script>
<style>
	page {
		background: #f8f9fd;
	}
</style>
<style lang="scss" scoped>
	.content {
		padding: 20rpx;
	}

	.item {
		background: #fff;
		border-radius: 20rpx;
		padding: 20rpx;
		margin-bottom: 20rpx;
	}

	.item:last-child {
		margin-bottom: 0rpx;
	}
</style>
